package dame4;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        int[] array = new int[str.length()];
        int cur =0 ;
        //int m = 0;
        for (int i=0;i<str.length();i++){
           char ch = str.charAt(i);
           //int sum = Integer.parseInt("ch");
           if (Character.isDigit(ch)){
               cur++;

           }else {
               cur = 0;
           }
           array[i] = cur;
        }
        for (int j=0;j<str.length();j++){
            int tmp = array[0];
            if (tmp<array[j+1]&&j+1<str.length()){
               int tpx = array[j+1];
               array[j+1] = tmp;
               tmp = tpx;
            }
        }
        System.out.println(array[0]);
    }
}
